#ifndef SHORTCUTINPUT_H
#define SHORTCUTINPUT_H

#include <QWidget>

#include <QKeySequence>

class ShortcutInput : public QWidget
{
		Q_OBJECT
	public:
		explicit ShortcutInput(QWidget *parent = 0);

		QKeySequence sequence() const;

	signals:

		void sequenceChanged();

	public slots:

		void resetSequence();
		void setSequence(const QKeySequence &value);

	protected:

		void focusInEvent(QFocusEvent *);
		void paintEvent(QPaintEvent *);
		void keyPressEvent(QKeyEvent *);
		void keyReleaseEvent(QKeyEvent *);
		void focusOutEvent(QFocusEvent *);

	private:

		bool _sequenceDefined;
		QString _text;
		QKeySequence _sequence;

};

#endif // SHORTCUTINPUT_H
